﻿@using MvcPaging
@model MvcApplication5.Models.IndexModel

@{
ViewBag.Title = "Home";
Layout = null;
}

@{  
    int i = 0;                       
}

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="/css/style.css" media ="all" />
    <link href="/CSS/styleSlide.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-base.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-topbar.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-sidebar.css" rel="stylesheet" />
    <script src="/CSS/ddlevelsmenu.js"></script>
    <script src="/CSS/jquerySlide.js"></script>
</head>

<body>
<div class="main">
	<div class="header">
        <div id="wowslider-container1">
	        <div class="ws_images">
                <ul>     
                    <li><img src="../../CSS/Images/banner.jpg" id="wows1_0" /></li>
                    <li><img src="../../CSS/Images/banner2.jpg" id="wows1_1"/></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_2" /></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_3" /></li>
                </ul>
            </div>
	    </div>
        <script src="../../Scripts/wowslider.js"></script>
        <script src="../../Scripts/scriptSlide.js"></script>
    </div> <!--End header-->
    <div class="header-footer"></div>
    <div id="ddtopmenubar" class="menu">
    	<ul style="padding-right:0px;">
        	<li class="menu-sub" style="background-color:#d90000; border-right:#d90000;"><a href="" class="menu-sub-text">Trang chủ</a></li>            
                @foreach (var item in Model.Categories.Where(c => c.Tag.Length == 4))
                {
                    <li class="menu-sub"><a href="/NewsSite/Category/@item.CategoryId" class="menu-sub-text">@item.Name</a></li>                               
                }
                @*@foreach (var item in Model.Categories.Where(c => c.Tag.Length == 4))
                {
                    <li class="menu-sub"><a href="/NewsSite/Category/@item.CategoryId" rel="ddsubmenu @(i+1)" class="menu-sub-text">@item.Name</a></li>
                    <ul id="ddsubmenu @(i+1)" class="ddsubmenustyle">
                           @foreach (var item1 in Model.Categories.Where(c => c.Tag.Length == 8 && c.Tag.Substring(0, 4).Contains(item.Tag)))
                           {
                                <li><a href="/NewsSite/Category/@item1.CategoryId" class="sub-menu-text">@item1.Name.ToUpper()</a></li>
                           }
                    </ul>
                        
                    i++;                              
                }*@
        </ul>
        <script type="text/javascript">
            ddlevelsmenu.setup("ddtopmenubar", "topbar")
        </script>
    </div> <!--End menu-->
    
    <div class="body">
    	<div class="body-left">
           <div class="body-left-topic01">
           		<div class="body-left-topic-header01">
                    <div class="body-left-topic-header03">
                	<div class="body-left-topic-header03-left">
                    	<div class="body-left-topic-header03-left-title">
							<h3 class="body-left-topic-header03-left-text">Tin nổi bật</h3>
                            
                        </div>
                    </div> <!--End body-left-topic-header03-left-->
                </div>
           		</div>
                <div class="body-left-topic-content01">                	
                    @foreach (var item in Model.Highlights)
                    {
                        if (item.NewsId == Model.Highlights.First().NewsId)
                        {
                            <div class="body-left-topic-content01-highlight01">
                    	        <div class="body-left-topic-content01-highlight-title">
                        	        <a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none"><h2 class="body-left-topic-content01-highlight01-text">@item.Title</h2></a>
                                </div>
                                <a href="/NewsSite/Details/@item.NewsId"><img class="body-left-topic-content01-highlight-image01" src="/css/images/@item.Image"></a>
                            </div>
                        }
                        else if(item.position != 6)
                        {
                            <div class="body-left-topic-content01-highlight02">
                    	        <div class="body-left-topic-content01-highlight-title">
                        	        <a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none"><h2 class="body-left-topic-content01-highlight02-text">@item.Title</h2></a>
                                </div>
                    	        <a href="/NewsSite/Details/@item.NewsId"><img class="body-left-topic-content01-highlight-image02" src="/css/images/@item.Image">
                            </div>
                        }
                    }
                </div> <!--End body-left-content01-->
           </div> <!--End body-left-topic01-->
           <!--<div class="body-left-topic02">
           		<div class="body-left-topic-header02"></div>
                <Div class="body-left-topic-content02">
                	<div></div>
                </Div>
           </div> <!--End body-left-topic02-->
           <div class="body-left-topic03">
           		<div class="body-left-topic-header03">
                	<div class="body-left-topic-header03-left">
                    	<div class="body-left-topic-header03-left-title">
							<h3 class="body-left-topic-header03-left-text">Tiêu điểm</h3>
                            
                        </div>
                    </div> <!--End body-left-topic-header03-left-->
                </div>
                <div class="body-left-topic-content03">
                	<div class="body-left-topic-content03-left">
                    	<a href="/NewsSite/Details/@Model.Focus.First().NewsId" style="text-decoration:none"><img src="/css/images/@Model.Focus.First().Image" width="250" height="125"></a>
                        <a href="/NewsSite/Details/@Model.Focus.First().NewsId" style="text-decoration:none"><h2 class="body-left-topic-content03-left-text">@Model.Focus.First().Title</h2></a>
                    </div> <!--End body-left-content03-left-->
                    <div class="body-left-topic-content03-right">
                    	<table class="body-left-topic-content03-right-table">                            
                            @foreach (var item in Model.Focus) {
                                if (item.NewsId != Model.Focus.First().NewsId)
                                {                                
                                    <tr>
                                        <td><a href="/NewsSite/Details/@item.NewsId"><img src="/css/images/@item.Image" width="90"; height="55";></a></td>
                                        <td><a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none">@item.Title</a></td>
                                    </tr>
                                }
                            }                           
                        </table>	
                    </div> <!--End body-left-content03-right-->                    
                </div> <!--End body-left-content03-->
           </div> <!--End body-left-topic03-01-->
           <div class="news-tab">
               <ul class="news-tab-menu">
                   @if(Model.type == 0){                   
                        <li class="news-tab-submenu"><a href="" class="news-tab-submenu-text">Tin mới</a></li>
                        <li class="news-tab-submenu2"><a href="/NewsSite?type=hot" class="news-tab-submenu-text2">Bài hot</a></li>
                   }else{
                        <li class="news-tab-submenu2"><a href="/NewsSite" class="news-tab-submenu-text2">Tin mới</a></li>
                        <li class="news-tab-submenu"><a href="/NewsSite?type=hot" class="news-tab-submenu-text">Bài hot</a></li>
                   }
               </ul>
           </div>
           @foreach(var item in Model.News){               
               if (i%2 == 0){
                   var Author = item.Author != null ? item.Author.Name : "";                             
                    <div class="category-newslist">
                        <div class="category-newslist-image">
                            <a href="/NewsSite/Details/@item.NewsId"><img src="/CSS/images/@item.Image" style="width:230px; height:180px"/></a>
                        </div>
                        <div class="category-newslist-content">
                            <h2><a href="/NewsSite/Details/@item.NewsId" class="category-newslist-title">@item.Title</a></h2>                            
                            <p>@Author | @item.PublishedDate | Chuyên mục: <a href="/NewsSite/Category/@item.CategoryId" class="category-newslist-category">@item.Category.Name</a></p>
                            <p class="category-newslist-summary">@item.Summary</p>
                        </div>                        
                    </div>
               }else{
                   var Author = item.Author != null ? item.Author.Name : "";
                   <div class="category-newslist2">
                        <div class="category-newslist-image">
                            <a href="/NewsSite/Details/@item.NewsId"><img src="/CSS/images/@item.Image" style="width:230px; height:180px"/></a>
                        </div>
                        <div class="category-newslist-content">
                            <h2><a href="/NewsSite/Details/@item.NewsId" class="category-newslist-title">@item.Title</a></h2>
                            <p>@Author | @item.PublishedDate | Chuyên mục: <a href="/NewsSite/Category/@item.CategoryId" class="category-newslist-category">@item.Category.Name</a></p>
                            <p class="category-newslist-summary">@item.Summary</p>
                        </div>                        
                    </div>
               }
               i++;
            }
            <div class="paging-box">
                <p class="pager">@Html.Pager(Model.News.PageSize, Model.News.PageNumber, Model.News.TotalItemCount)</p>                                   
            </div>
        </div> <!--End body-left-->
        <div class="body-right">
            <div class="body-right-header">
                @using(Html.BeginForm("Search","NewsSite")){
                    <input type="text" class="body-right-searchbar" name="searchString"/>
                    <input type="submit" class="body-right-searchbutton" value="Tìm kiếm"/>
                }
            </div>            
            <div class="body-right-content2">
                <div class="body-right-header">
                    <h3 class="body-right-title">Xem nhiều nhất</h3>
                </div>
                <div class="body-right-content2-scroll">                                                
                <table class="body-left-topic-content03-right-table">                            
                            @foreach (var item in Model.MostViewed) {                                                                
                                    <tr>
                                        <td><a href="/NewsSite/Details/@item.NewsId"><img src="/css/images/@item.Image" width="90"; height="55";></a></td>
                                        <td><a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none">@item.Title</a></td>
                                    </tr>                                
                            }                           
                </table>
                </div>
            </div>
            @foreach(var item in Model.Advertisement){
                <div class="body-right-content">
                    <div class="advertise-item">
                        <div class="advertise-title">@item.Title</div>
                        <div class="advertise-link">@item.link</div>
                    <div class="advertise-content">
                        <img width="90" height="90" src="../../CSS/Images/@item.Image"/>
                        <div class="advertise-description">
                            @item.Description
                        </div>
                    </div>                    
                </div>                
            </div>
            }
            <div class="body-right-content">                
                <div class="body-right-header">
                    <h3 class="body-right-title">Bình luận mới</h3>
                </div>
                @foreach (var item in Model.Comments)
                {                    
                    <div class="body-right-content-comment">
                        <span class="body-right-content-conmment-text1">@item.Name</span>
                        <span class="body-right-content-conmment-text2"><a>@item.Content</a></span>
                        <div class="body-right-content-comment-article"><a href="/NewsSite/Details/@item.News.NewsId" style="text-decoration:none">->  @item.News.Title</a></div>
                    </div>                    
                }
            </div>            
        </div> <!--End body-right-->
    </div> <!--End body-->
    
</div> <!--End main-->
</body>
</html>

